#ifndef REALNUMBER_H_INCLUDED
#define REALNUMBER_H_INCLUDED

#include "../formula/formulaelement.h"
#include "../util/doubletostring.h"
#include <cstdlib>

class RealNumber : public FormulaElement {

private:
    double *value;
public:
    RealNumber();
    // Constructor
    RealNumber(const double& newValue);
    // Constructor with value
    RealNumber(RealNumber& myRealNumber);
    // copy constructor
    ~RealNumber();
    // Destructor
    const double& getValue();
    // returns const reference to value
    std::string& toString();
    // classic toString
    void evaluateMe(LinkedList<double>& evaluationStack, const double* positionArray);
    // add mySelf to the evaluationStack
    bool isNumber() {   return true;    };
    // no comment
    void mutate();
    // mutate this Element
    friend bool operator==(RealNumber& r1, RealNumber& r2);
	// overloading operator==
    static inline double& getRealRandomNumber(int shift, int minus) {
        return *(new double((rand()>>shift)-minus  +((double)(rand()>>18))/(8191.0)));
    };
    // generates a random number within boarders given
    FormulaElement& copy();
    // returns a new RealNumber (copy of this)
    void createHumanReadeableToString(LinkedList<std::string>& toStringStack);
    // add this element to the human readeable toString
};

#endif // REALNUMBER_H_INCLUDED
